% This function takes a date range , and longitude get the data from the
% ppefmtest  real-time caculator and returns the value

function[fday, pp, fejer, ief_ey] = getppefmtest(year,month,day ,nDays, longitude)

baseurl = 'http://2.pp-efm.appspot.com/ppefmtest?';


thisquerystring = sprintf('year=%d&month=%d&day=%d&utc=0&nDays=%d&long=%d', ...
    year,month,day,nDays,longitude);

s = urlread([baseurl thisquerystring]);

s = strrep(s,'</br>', ' ');


data = sscanf(s,'%f',[8 Inf])';

pp = data(:,8);
fday = datenum(data(:,1),data(:,2),data(:,3),data(:,4),data(:,5),0);
fejer = data(:,7);
ief_ey = data(:,6);